package com.dcy.znoa.common.util.wj;

/**
 * Created by $ pengyu on 2018/8/16.
 */
public class MyThread33 extends Thread{

    public MyThread33() {
        super();
    }

    @Override
    public void run() {
        System.out.println("run "+Thread.currentThread().getName());//答应的是a
        System.out.println("run "+this.getName());//打印的是Thread-0
        System.out.println(this==Thread.currentThread());//false  这两个线程不是同一个
    }


    public static void main(String[] args) {
        MyThread33 mm = new MyThread33();
        Thread t = new Thread(mm);
        t.setName("a");
        t.start();
        mm.setName("线程1");//直接启动线程mm
        mm.start();
    }

}
